package com.school.entity;


public class Teacher extends Person {
    private Course course;


    public Teacher(String id, String name, String gender) {
        super(id, name, gender);
    }


    @Override
    public void printWorksheet() {
        super.printWorksheet();
        System.out.println("身份: 教师");
        if (course != null) {
            System.out.println("授课课程: " + course.getName());
            System.out.println("上课地点: " + course.getLocation());
            System.out.println("上课时间: " + course.getTime());
        } else {
            System.out.println("暂未分配课程");
        }
        System.out.println("=============\n");
    }


    public void setCourse(Course course) {
        this.course = course;
    }

    public Course getCourse() {
        return course;
    }
}